Foxit PDF RDK
|
Foxit PDF ViewCtrl namespace. More...
Namespaces | |
GeometryUtil | |
GeometryUtil namespace. | |
Classes | |
class | CallBack |
CallBack interface. More... | |
class | FSCallBack |
FSCallBack interface. More... | |
class | IDocEventListener |
class | IDrawEventListener |
class | IGestureEventListener |
The gesture event listener. More... | |
class | IPageAutoEventListener |
class | IPageEventListener |
class | IPDFLayoutEventListener |
class | IRecoveryEventListener |
class | IRotationEventListener |
class | ITouchEventListener |
class | IUIExtensionsManager |
struct | PDFViewCtrl |
class | PDFViewCtrlModel |
PDFViewCtrlModel class. More... | |
class | PointF |
PointF Class. More... | |
class | RectF |
RectF Class. More... | |
class | SDKUtil |
SDKUtil Class. More... | |
class | Task |
Task Class. More... | |
Enumerations | |
enum | ACTION_TYPE { ACTION_START, ACTION_UPDATE, ACTION_CANCEL, ACTION_END } |
enum | PAGE_AUTO_EVENT_TYPE |
PAGE_AUTO_EVENT_TYPE enum. | |
enum | PAGE_LAYOUT_MODE { UNKNOWN = 0, SINGLE, REFLOW, FACING, COVER } |
PAGE_LAYOUT_MODE enum. More... | |
enum | PAGE_SPACING_DIRECTION { HORIZONTAL = 1, VERTICAL } |
PAGE_SPACING_DIRECTION enum. More... | |
enum | PDF_CROP_MODE { , CUSTOMIZE = 0 } |
PDF_CROP_MODE enum. More... | |
enum | PDF_PAGE_BINDING_EDGE { UNKNOWN = 0, LEFT, RIGHT } |
PDF_PAGE_BINDING_EDGE enum. More... | |
enum | PDF_PAGE_STYLE { UNKNOWN = 0, BLANK, LINED, GRID, GRAPH, MUSIC } |
PDF_PAGE_STYLE enum. More... | |
enum | PDF_ZOOM_FIT_RECT_MODE { FIT_RECT, FIT_WIDTH, FIT_HEIGHT } |
PDF_ZOOM_FIT_RECT_MODE enum. More... | |
enum | PDF_ZOOM_MODE { CUSTOMIZE = 0, FIT_WIDTH, FIT_HEIGHT, FIT_PAGE } |
PDF_ZOOM_MODE enum. More... | |
enum | STATUS |
STATUS enum. | |
Foxit PDF ViewCtrl namespace.
FoxitPDFViewCtrl.addFSTask | ( | task | ) |
Add task to view control.
task | The task which would be added. |
async FoxitPDFViewCtrl.addImagePage | ( | dstIndex | , |
imagePath | |||
) |
Add image as a page for the current document.
dstIndex | A page index in current PDF document. This is used to specify where the image will be added. If parameter dstIndex is less than 0, the image will be added to the first. If parameter dstIndex is equal to or larger than current page count, the image will be added to the end. |
imagePath | The image path. The format of the picture needs to be in line with Android's official requirements(.jpg,.png,.gif,.bmp,.webp) |
true
means success, while false
means failure. FoxitPDFViewCtrl.enablePageFlippingByTouchBorder | ( | pageFlipping | ) |
Whether to flip the page by touching border.
pageFlipping | true means to flip page by touching border. |
FoxitPDFViewCtrl.enableTilingRefresh | ( | isTilingRefresh | ) |
Whether to refresh page view by using tiling or not.
isTilingRefresh | true means using tiling refresh. or refresh the whole page view. |
FoxitPDFViewCtrl.enableTurnPageBySliding | ( | isTurnPageBySliding | ) |
Whether to turn the page by sliding.
NOTE: 1: if turn the page by sliding is disabled, then you should turn pages byPDFViewCtrlModel.gotoPage yourself. 2: This will only take effect when PDFViewCtrlModel.isContinuous is false.
isTurnPageBySliding | true means turn page by sliding, or turn page without sliding |
FoxitPDFViewCtrl.getAppProvider | ( | ) |
Get the AppProviderCallback
object.
AppProviderCallback
object. FoxitPDFViewCtrl.getCropMode | ( | ) |
FoxitPDFViewCtrl.getCropRect | ( | pageIndex | ) |
Return the crop rect of the specified page.
pageIndex | Page index of the cropped page. |
<void> FoxitPDFViewCtrl.getDoc | ( | ) |
Get current displayed PDF document from view control
PDFDoc
object which represents current PDF document.FoxitPDFViewCtrl.getFilePath | ( | ) |
Return the current file path.
FoxitPDFViewCtrl.getMaxZoomLimit | ( | ) |
Get the maximum zoom bound
FoxitPDFViewCtrl.getMinZoomLimit | ( | ) |
Get the minimum zoom bound
FoxitPDFViewCtrl.getPageBinding | ( | ) |
Get the current document's PageBinding.
FoxitPDFViewCtrl.getPageCount | ( | ) |
Get the page count of PDF document.
FoxitPDFViewCtrl.getUserPermission | ( | ) |
Get user access permissions.
FoxitPDFViewCtrl.getViewRotation | ( | ) |
FoxitPDFViewCtrl.getXFADoc | ( | ) |
Get the current XFA document.
XFADoc
object which represents current XFA document.FoxitPDFViewCtrl.insertPages | ( | index | , |
width | , | ||
height | , | ||
style | , | ||
color | , | ||
rotation | , | ||
count | |||
) |
Insert a new blank PDF page to document, by index. After all operations are ended, you need to call the PDFViewCtrlModel.updatePagesLayout to update pages layout.
index | A page index in current PDF document. This is used to specify where the imported pages will be inserted. If parameter index is less than 0, the new page will be inserted to the first. If parameter index is equal to or larger than the count of pages, the new page will be inserted to the end. |
width | Width of new page (unit is 1/72 inch). |
height | Height of new page (unit is 1/72 inch). |
style | Style of new page.Please refer to values starting from PDF_PAGE_STYLE.BLANKand this should be one of these values. Default value: PDF_PAGE_STYLE.BLANK |
color | Color of new page. Format: 0xAARRGGBB. |
rotation | Rotation value of new page. Please refer to values starting from FoxitRDKNative.e_Rotation0 and this should be one of these values except FoxitRDKNative.e_RotationUnknown |
count | The count of new pages to be inserted. |
true
means success, while false
means failure. FoxitPDFViewCtrl.insertPagesByPath | ( | dstIndex | , |
flags | , | ||
layerName | , | ||
srcFilePath | , | ||
password | , | ||
pageRanges | [] | ||
) |
Start to import pages from another PDF document (via file path). After all operations are ended, you need to call the PDFViewCtrlModel.updatePagesLayout to update pages layout.
Note: Currently not support to import pages from a PDF which contains XFA form.
dstIndex | A page index in current PDF document. This is used to specify where the imported pages will be inserted. If parameter dstIndex is less than 0, the imported pages will be inserted to the first. If parameter dstIndex is equal to or larger than current page count, the imported pages will be inserted to the end. |
flags | Options for importing pages. Please refer to values starting from FoxitRDKNative.PDFDoc.e_ImportFlagNormal and this can be one or combination of these values. |
layerName | The name of non-selectable label or the prefix name of the non-selectable label to be shown in layer panel of application, in UTF-8 encoding. If parameter flags contains FoxitRDKNative.PDFDoc.e_ImportFlagWithLayers, this should not be empty and should be a valid string. If parameter flags does not contain FoxitRDKNative.PDFDoc.e_ImportFlagWithLayers, this string will be ignored.
|
srcFilePath | The file path of source PDF document, from which some pages will be imported to current PDF document. |
password | The password string for source PDF document. It should be in UTF-8 encoding. If source PDF document is not encrypted by password, just pass an empty string. |
pageRanges | An integer array which contains the page ranges of source PDF document, to be imported. In this array, 2 numbers are a pair: the first integer is the starting page index, and the second integer is the page count. This parameter is not null , it should contains at least 2 numbers, and the count of elements should be a multiples of 2. |
true
means success, while false
means failure. FoxitPDFViewCtrl.insertPagesByPDFDoc | ( | dstIndex | , |
flags | , | ||
layerName | , | ||
srcDoc | , | ||
pageRanges | [] | ||
) |
Start to import pages from another PDF document (via file path). After all operations are ended, you need to call the PDFViewCtrlModel.updatePagesLayout to update pages layout.
Note: Currently not support to import pages from a PDF which contains XFA form.
dstIndex | A page index in current PDF document. This is used to specify where the imported pages will be inserted. If parameter dstIndex is less than 0, the imported pages will be inserted to the first. If parameter dstIndex is equal to or larger than current page count, the imported pages will be inserted to the end. |
flags | Options for importing pages. Please refer to values starting from FoxitRDKNative.PDFDoc.e_ImportFlagNormal and this can be one or combination of these values. |
layerName | The name of non-selectable label or the prefix name of the non-selectable label to be shown in layer panel of application, in UTF-8 encoding. If parameter flags contains FoxitRDKNative.PDFDoc.e_ImportFlagWithLayers, this should not be empty and should be a valid string. If parameter flags does not contain FoxitRDKNative.PDFDoc.e_ImportFlagWithLayers, this string will be ignored.
|
srcDoc | A PDFDoc object |
pageRanges | An integer array which contains the page ranges of source PDF document, to be imported. In this array, 2 numbers are a pair: the first integer is the starting page index, and the second integer is the page count. If this parameter is not null , it should contains at least 2 numbers, and the count of elements should be a multiples of 2. |
true
means success, while false
means failure. FoxitPDFViewCtrl.insertPagesBySize | ( | index | , |
size | , | ||
style | , | ||
color | , | ||
rotation | , | ||
count | |||
) |
Insert a new blank PDF page to document, by index. After all operations are ended, you need to call the PDFViewCtrlModel.updatePagesLayout to update pages layout.
index | A page index in current PDF document. This is used to specify where the imported pages will be inserted. If parameter index is less than 0, the new page will be inserted to the first. If parameter index is equal to or larger than the count of pages, the new page will be inserted to the end. |
size | Size type of new page. Please refer to values starting from FoxitRDKNative.PDFPage.e_SizeLetterand this should be one of these values. Default value: FoxitRDKNative.PDFPage.e_SizeLetter |
style | Style of new page.Please refer to values starting from PDF_PAGE_STYLE.BLANKand this should be one of these values. Default value: PDF_PAGE_STYLE.BLANK |
color | Color of new page. Format: 0xAARRGGBB. |
rotation | Rotation value of new page.Please refer to values starting from FoxitRDKNative.e_Rotation0 and this should be one of these values except FoxitRDKNative.e_RotationUnknown |
count | The count of new pages to be inserted. |
true
means success, while false
means failure. FoxitPDFViewCtrl.invalidate | ( | dirty | = GeometryUtil.FGRectMakeZero() | ) |
Add task to view control.
task | The task which would be added. |
FoxitPDFViewCtrl.isDynamicXFA | ( | ) |
Check whether the current xfa document is Dynamic xfa.
true
means the current xfa document is Dynamic xfa, while false
means the current xfa document is not Dynamic xfa. FoxitPDFViewCtrl.isOwner | ( | ) |
Check whether current user is the owner.
true
means current user is the owner, while false
means current user is not the owner. FoxitPDFViewCtrl.isPageFlippingByTouchBorder | ( | ) |
Check whether to flip the page by touching border.
true
means current user is the owner, while false
means current user is not the owner. FoxitPDFViewCtrl.isPageVisible | ( | pageIndex | ) |
Check whether a specified page is visible or not.
pageIndex | Page index.Valid range: from 0 to (count -1). count is the page count. |
true
means the specified page is visible. false
means the specified page is invisible. FoxitPDFViewCtrl.movePage | ( | index | , |
dstIndex | |||
) |
Move page to destination index. After all operations are ended, you need to call the PDFViewCtrlModel.updatePagesLayout to update pages layout.
index | The index of page to be moved. It should be in current PDF document. |
dstIndex | Index of the destination position in page array. Valid range: from 0 to (count-1). count is returned by function PDFDoc.GetPageCount. If parameter dstIndex is just the same as the page index of parameter page, no change will be done and this function will return true directly. |
true
means success, while false
means failure. async FoxitPDFViewCtrl.recoverForOOM | ( | ) |
Do the recovering when Foxit PDF SDK runs out of memory.
Foxit PDF SDK will call this method automatically. This needs to be used carefully. Current reading status will be restored, but all the editing to document will be lost.
FoxitPDFViewCtrl.registerDocEventListener | ( | listener | ) |
Register a document event listener.
listener | An IDocEventListener object to be registered. |
FoxitPDFViewCtrl.registerDrawEventListener | ( | listener | ) |
Register a draw event listener.
listener | An IDrawEventListener object to be registered. |
FoxitPDFViewCtrl.registerGestureEventListener | ( | listener | ) |
Register a gesture event listener.
listener | An IGestureEventListener object to be registered. |
FoxitPDFViewCtrl.registerLayoutEventListener | ( | listener | ) |
Register a layout mode event listener.
listener | An ILayoutEventListener object to be registered. |
FoxitPDFViewCtrl.registerPageAutoEventListener | ( | listener | ) |
Register a page auto event listener.
listener | An IPageAutoEventListener object to be registered. |
FoxitPDFViewCtrl.registerPageEventListener | ( | listener | ) |
Register a page event listener.
listener | An IPageEventListener object to be registered. |
<boolean> FoxitPDFViewCtrl.registerRecoveryEventListener | ( | listener | ) |
Register an event listener for recovery from running out of memory.
listener | An IRecoveryEventListener object to be registered. |
FoxitPDFViewCtrl.registerReflowEventListener | ( | listener | ) |
Register a reflow event listener.
listener | An IReflowEventListener object to be registered. |
FoxitPDFViewCtrl.registerRenderEventListener | ( | listener | ) |
Register a render event listener.
listener | An IRenderEventListener object to be registered. |
FoxitPDFViewCtrl.registerTouchEventListener | ( | listener | ) |
Register a touch event listener.
listener | An ITouchEventListener object to be registered. |
FoxitPDFViewCtrl.removePages | ( | pageIndexes | [] | ) |
Remove pages from pdf document.
After all operations are ended, you need to call the PDFViewCtrlModel.updatePagesLayout to update pages layout.
pageIndexes | An integer array specify which pages will be removed. If the array contains all pages, it will delete all pages except the first one and return false. |
true
means success, while false
means failure. FoxitPDFViewCtrl.removeTask | ( | task | ) |
Remove the task.
task | The task which would be removed. |
FoxitPDFViewCtrl.resetCropResources | ( | ) |
Resets the crop resources. Call this before using setCropRect to apply a new crop rectangle for all pages after a previous crop has been set.
FoxitPDFViewCtrl.rotatePages | ( | pageIndexes | [], |
rotation | |||
) |
Rotate pages with specified rotation. After all operations are ended, you need to call the PDFViewCtrlModel.updatePagesLayout to update pages layout.
pageIndexes | An integer array specify which pages will be rotated. |
rotation | New page rotation value. Please refer to values starting from FoxitRDKNative.e_Rotation0 and this should be one of these values. |
true
means success, while false
means failure. FoxitPDFViewCtrl.rotateView | ( | rotation | ) |
Rotates all pages in the document by using the specified degrees clockwise.
Note: After calling this method you must also update the page layout. See PDFViewCtrlModel.updatePagesLayout for more information.
rotation | The rotation to be used. Please refer to values starting from FoxitRDKNative.e_Rotation0 and this should be one of these values. |
FoxitPDFViewCtrl.scrollView | ( | distanceX | , |
distanceY | |||
) |
Scroll display view by the specified offset.
distanceX | The distance along the X axis that has been scrolled. |
distanceY | The distance along the Y axis that has been scrolled. |
FoxitPDFViewCtrl.setAppProvider | ( | callback | ) |
Set a customized AppProviderCallback
object.
User can call this function to set a customized app provider, and this function should be called first before processing XFA document.
If this function has not been called even once, it will use the default xfa provider.
callback | An AppProviderCallback object, which is implemented by user and based on callback class AppProviderCallback . |
FoxitPDFViewCtrl.setCropMode | ( | mode | ) |
Set the page crop mode. Each page will be cropped separately according to the crop mode.
mode | Crop mode. Please refer to values starting from PDF_CROP_MODE.NONE |
true
means success, while false
means failure. FoxitPDFViewCtrl.setCropRect | ( | pageIndex | , |
cropRect | |||
) |
Set crop rect of the specified page, others are original as default.
This method only takes effect when cropMode is set to PDF_CROP_MODE.CUSTOMIZE. After calling this method, please invoke setCropMode(PDF_CROP_MODE.CUSTOMIZE) to apply the changes.
pageIndex | Page index of the cropped page. Valid range: from 0 to (count -1). count is the page count. -1 means the same rect to all pages. |
cropRect | The crop rectangle on the PDF page, in pdf coordinate, make sure left <= right, and bottom <= top. |
true
means success, while false
means failure. FoxitPDFViewCtrl.setDoc | ( | pdfDocument | ) |
Set the PDF document object to view control, then open the document.
pdfDocument | A PDFDoc object which specifies the pdf document to be opened. |
FoxitPDFViewCtrl.setFilePath | ( | filePath | ) |
Set the file path of the current document.
filePath | the path of the current document. |
FoxitPDFViewCtrl.setMaxZoomLimit | ( | maxZoomLimit | ) |
Set the maximum zoom bound.
This method sets the upper limit for zooming in. The maximum zoom limit cannot be less than 1. If a value less than 1 is provided, it will be ignored and the default value will remain in effect.
maxZoomLimit | the maximum zoom bound, default: 8.0f |
FoxitPDFViewCtrl.setMinZoomLimit | ( | minZoomLimit | ) |
Set the minimum zoom bound
This method sets the lower limit for zooming out. The minimum zoom limit must be greater than 0 and cannot exceed 1. If a value outside this range is provided, it will be ignored, and the default value will remain in effect.
minZoomLimit | the minimum zoom bound, default: 1.0f |
FoxitPDFViewCtrl.setPageBinding | ( | pageBinding | ) |
Set the PDF_PAGE_BINDING_EDGE controlling in which direction pages of documents are laid out, either left to right (page indexed 0 will be to the left),or right to left (page indexed 0 will be on the right), default pagebinding is LEFT_EDGE.
pageBinding | The PDF_PAGE_BINDING_EDGE to set on the document. |
FoxitPDFViewCtrl.setPageSpacing | ( | space | , |
direction | = PAGE_SPACING_DIRECTION.HORIZONTAL |
||
) |
Sets the vertical and horizontal spacing between adjacent pages in the view. If the layout has already been loaded, you need to call updatePagesLayout for the changes to take effect.
Note: Currently, It supports in PAGE_LAYOUT_MODE.FACING, PAGE_LAYOUT_MODE.COVER mode and PAGE_LAYOUT_MODE.SINGLE mode is continuous.
space | spacing(in pixels) between adjacent pages in the view. Valid range: from 0 to 10. Note: The default value of the horizontal spacing is 2, and the default value of the vertical spacing is 10. |
direction | Used to decide which kind of direction spacing will be set. Please refer to values starting from PAGE_SPACING_DIRECTION.HORIZONTAL and this can be one or a combination of these values. |
FoxitPDFViewCtrl.unregisterDocEventListener | ( | listener | ) |
Unregister a document event listener.
listener | An IDocEventListener object to be unregistered. |
FoxitPDFViewCtrl.unregisterDrawEventListener | ( | listener | ) |
Unregister a draw event listener.
listener | An IDrawEventListener object to be unregistered. |
FoxitPDFViewCtrl.unregisterGestureEventListener | ( | listener | ) |
Unregister a gesture event listener.
listener | An IGestureEventListener object to be unregistered. |
FoxitPDFViewCtrl.unregisterLayoutEventListener | ( | listener | ) |
Unregister a layout mode event listener.
listener | An ILayoutEventListener object to be unregistered. Unregister a rotation mode event listener. |
listener | An IRotationEventListener object to be unregistered. |
FoxitPDFViewCtrl.unregisterPageAutoEventListener | ( | listener | ) |
Unregister a page auto event listener.
listener | An IPageAutoEventListener object to be unregistered. |
FoxitPDFViewCtrl.unregisterPageEventListener | ( | listener | ) |
Unregister a page event listener.
listener | An IPageEventListener object to be unregistered. |
FoxitPDFViewCtrl.unregisterRecoveryEventListener | ( | listener | ) |
Unregister an event listener for recovery from running out of memory.
listener | An IRecoveryEventListener object to be unregistered. |
FoxitPDFViewCtrl.unregisterReflowEventListener | ( | listener | ) |
Unregister a reflow event listener.
listener | An IReflowEventListener object to be unregistered. |
FoxitPDFViewCtrl.unregisterRenderEventListener | ( | listener | ) |
Unregister a render event listener.
listener | An IRenderEventListener object to be unregistered. |
FoxitPDFViewCtrl.unregisterRotationEventListener | ( | listener | ) |
Unregister a rotation mode event listener.
listener | An IRotationEventListener object to be unregistered. |
FoxitPDFViewCtrl.unregisterTouchEventListener | ( | listener | ) |
Unregister a touch event listener.
listener | An ITouchEventListener object to be unregistered. |
FoxitPDFViewCtrl.updatePagesLayout | ( | ) |
Update pages layout, you should call this function to update pages layout when some pages be removed, inserted, moved or rotates all pages.